﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace HCFramework.AdminTool.Dashboard
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadServerInfo();
                LoadClientInfo();
            }
        }

        private void LoadClientInfo()
        {
            System.Web.HttpBrowserCapabilities browser = Request.Browser;
            litType.Text = browser.Type;
            litBrowser.Text = browser.Browser;
            litVersion.Text = browser.Version;
            litPlatform.Text = browser.Platform;
            litCookies.Text = browser.Cookies.ToString();
            string myHost = System.Net.Dns.GetHostName();
            litServerIP.Text = System.Net.Dns.GetHostEntry(myHost).AddressList[0].ToString();
        }

        private void LoadServerInfo()
        {
            litDotNetVersion.Text = System.Environment.Version.ToString();
            litHostName.Text = System.Environment.MachineName;
            litOSVersion.Text = System.Environment.OSVersion.ToString();
            litPath.Text = Server.MapPath("~");
            litServerTime.Text = DateTime.Now.ToString();
            litWebServerVersion.Text = Request.ServerVariables["SERVER_SOFTWARE"];
            litClientIP.Text = M.Common.GetIpAddress();
        }
    }
}